export class BOMStructureBean {

    // 行号
    _rowIndex;

    // 级别
    _level;
    // 编号
    _number;
    // 名称
    _name;
    // 数量
    _quantity;
    // 零件类型
    _partType;
    // 零件类别
    _partClass;
    // 阶段
    _phase;
    // 版次
    _iteration;
    // 子节点
    _children = [];

    _numberPath;
    _parentNumber;

    _partInfo;
    _linkId;
    _structureId;

    constructor(rowIndex, level, number, name, quantity, partType, partClass, phase, iteration) {

        this._rowIndex = rowIndex;
        this._level = level;
        this._number = number;
        this._name = name;
        this._quantity = quantity;
        this._partType = partType;
        this._partClass = partClass;
        this._phase = phase;
        this._iteration = iteration;

        this._children = [];

        this._numberPath = '';
        this._parentNumber = '';
        this._partInfo = {};
        this._linkId = '';
    }

    getRowIndex() {
        return this._rowIndex;
    }

    setRowIndex(value) {
        this._rowIndex = value;
    }

    getLevel() {
        return this._level;
    }

    setLevel(value) {
        this._level = value;
    }

    getNumber() {
        return this._number;
    }

    setNumber(value) {
        this._number = value;
    }

    getName() {
        return this._name;
    }

    setName(value) {
        this._name = value;
    }

    getQuantity() {
        return this._quantity;
    }

    setQuantity(value) {
        this._quantity = value;
    }

    getPartType() {
        return this._partType;
    }

    setPartType(value) {
        this._partType = value;
    }

    getPartClass() {
        return this._partClass;
    }

    setPartClass(value) {
        this._partClass = value;
    }

    getPhase() {
        return this._phase;
    }

    setPhase(value) {
        this._phase = value;
    }

    getIteration() {
        return this._iteration;
    }

    setIteration(value) {
        this._iteration = value;
    }

    getChildren() {
        return this._children;
    }

    setChildren(children) {
        if (Array.isArray(children)) {
            this._children = children;
        }
    }

    addChild(bean) {
        this.getChildren().push(bean);
    }

    getNumberPath() {
        return this._numberPath;
    }

    setNumberPath(value) {
        this._numberPath = value;
    }

    getParentNumber() {
        return this._parentNumber;
    }

    setParentNumber(value) {
        this._parentNumber = value;
    }

    getPartInfo() {
        return this._partInfo;
    }

    setPartInfo(value) {
        this._partInfo = value;
    }


    getLinkId() {
        return this._linkId;
    }

    setLinkId(value) {
        this._linkId = value;
    }


    getStructureId() {
        return this._structureId;
    }

    setStructureId(value) {
        this._structureId = value;
    }
}

export function newEmptyInstanse() {
    return new BOMStructureBean('', '', '', '', '', '', '', '', '');
}